home *** CD-ROM | disk | FTP | other *** search
/ Aminet 14 / Aminet 14 - Oct 1996.iso / Tools / MUI / Developer / C / Include / inline / muimaster.h
C/C++ Source or Header  |  1996-07-13  |  8KB  |  312 lines

  1. #ifndef _INLINE_MUIMASTER_H
  2. #define _INLINE_MUIMASTER_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL /*extern struct Library* MUIMasterBase;*/
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME MUIMasterBase
  18. #endif
  19.  
  20. extern struct Library* MUIMasterBase;
  21.  
  22.   __inline
  23. APTR MUI_AllocAslRequest( BASE_PAR_DECL unsigned long type, struct TagItem *tagList)
  24.  
  25. {
  26.   BASE_EXT_DECL
  27.   register APTR res __asm("d0");
  28.   register struct Library* a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = type;
  30.   register struct TagItem* a0 __asm("a0") = tagList;
  31.  
  32.   __asm volatile ("jsr a6@(-0x30)"
  33.   : "=r" (res)
  34.   : "r" (a6), "r" (d0), "r" (a0)
  35.   : "d0","d1", "a0", "a1", "memory" );
  36.   return res;
  37. }
  38.  
  39.   APTR MUI_AllocAslRequestTags(ULONG type, Tag tag1, ...)
  40. {
  41.  return(MUI_AllocAslRequest(type, (struct TagItem *) &tag1));
  42. }
  43.  
  44.  
  45.  
  46. __inline
  47. BOOL MUI_AslRequest( BASE_PAR_DECL APTR requester, struct TagItem *tagList)
  48. {
  49.   BASE_EXT_DECL
  50.   register BOOL res __asm("d0");
  51.   register struct Library* a6 __asm("a6") = BASE_NAME;
  52.   register APTR a0 __asm("a0") = requester;
  53.   register struct TagItem* a1 __asm("a1") = tagList;
  54.  
  55.   __asm volatile ("
  56.   jsr a6@(-0x36)"
  57.   : "=r" (res)
  58.   : "r" (a6), "r" (a0), "r" (a1)
  59.   : "d0", "d1", "a0", "a1" );
  60.   return res;
  61. }
  62.   BOOL MUI_AslRequestTags(APTR req, Tag tag1, ...)
  63. {
  64.  return(MUI_AslRequest(req, (struct TagItem *) &tag1));
  65. }
  66.  
  67.  
  68.  
  69.  
  70. __inline
  71. struct MUI_CustomClass*
  72. MUI_CreateCustomClass( BASE_PAR_DECL struct Library *base, char *supername, struct MUI_CustomClass *supermcc, int datasize, APTR dispatcher)
  73. {
  74.   BASE_EXT_DECL
  75.   register struct MUI_CustomClass* res __asm("d0");
  76.   register struct Library* a6 __asm("a6") = BASE_NAME;
  77.   register struct Library* a0 __asm("a0") = base;
  78.   register char* a1 __asm("a1") = supername;
  79.   register struct MUI_CustomClass* a2 __asm("a2") = supermcc;
  80.   register int d0 __asm("d0") = datasize;
  81.   register APTR a3 __asm("a3") = dispatcher;
  82.  
  83.   __asm volatile ("
  84.   jsr a6@(-0x6c)"
  85.   : "=r" (res)
  86.   : "r" (a6), "r" (a0), "r" (a1), "r" (a2), "r" (d0), "r" (a3)
  87.   : "d0", "d1", "a0", "a1", "a2", "a3" );
  88.   return res;
  89. }
  90.   __inline
  91. BOOL MUI_DeleteCustomClass( BASE_PAR_DECL struct MUI_CustomClass* mcc)
  92. {
  93.   BASE_EXT_DECL
  94.   register BOOL res __asm("d0");
  95.   register struct Library* a6 __asm("a6") = BASE_NAME;
  96.   register struct MUI_CustomClass* a0 __asm("a0") = mcc;
  97.  
  98.   __asm volatile ("
  99.   jsr a6@(-0x72)"
  100.   : "=r" (res)
  101.   : "r" (a6), "r" (a0)
  102.   : "d0", "d1", "a0", "a1" );
  103.   return res;
  104. }
  105.   __inline void MUI_DisposeObject( BASE_PAR_DECL Object *obj)
  106. {
  107.   BASE_EXT_DECL
  108.   register res __asm("d0");
  109.   register struct Library* a6 __asm("a6") = BASE_NAME;
  110.   register Object* a0 __asm("a0") = obj;
  111.  
  112.   __asm volatile ("
  113.   jsr a6@(-0x24)"
  114.   : "=r" (res)
  115.   : "r" (a6), "r" (a0)
  116.   : "d0", "d1", "a0", "a1" );
  117. }
  118.   __inline LONG MUI_Error( BASE_PAR_DECL0 )
  119. {
  120.   BASE_EXT_DECL
  121.   register LONG res __asm("d0");
  122.   register struct Library* a6 __asm("a6") = BASE_NAME;
  123.  
  124.   __asm volatile ("
  125.   jsr a6@(-0x42)"
  126.   : "=r" (res)
  127.   : "r" (a6)
  128.   : "d0", "d1", "a0", "a1" );
  129.   return res;
  130. }
  131.   __inline void MUI_FreeAslRequest( BASE_PAR_DECL APTR requester)
  132. {
  133.   BASE_EXT_DECL
  134.   register res __asm("d0");
  135.   register struct Library* a6 __asm("a6") = BASE_NAME;
  136.   register APTR a0 __asm("a0") = requester;
  137.  
  138.   __asm volatile ("
  139.   jsr a6@(-0x3c)"
  140.   : "=r" (res)
  141.   : "r" (a6), "r" (a0)
  142.   : "d0", "d1", "a0", "a1" );
  143. }
  144.   __inline void MUI_FreeClass( BASE_PAR_DECL struct IClass *classptr)
  145. {
  146.   BASE_EXT_DECL
  147.   register res __asm("d0");
  148.   register struct Library* a6 __asm("a6") = BASE_NAME;
  149.   register struct IClass* a0 __asm("a0")=classptr;
  150.  
  151.   __asm volatile ("
  152.   jsr a6@(-0x54)"
  153.   : "=r" (res)
  154.   : "r" (a6), "r" (a0)
  155.   : "d0", "d1", "a0", "a1" );
  156. }
  157.   __inline struct IClass* MUI_GetClass( BASE_PAR_DECL char *classname)
  158. {
  159.   BASE_EXT_DECL
  160.   register struct IClass* res __asm("d0");
  161.   register struct Library* a6 __asm("a6") = BASE_NAME;
  162.   register char* a0 __asm("a0")=classname;
  163.  
  164.   __asm volatile ("
  165.   jsr a6@(-0x4e)"
  166.   : "=r" (res)
  167.   : "r" (a6), "r" (a0)
  168.   : "d0", "d1", "a0", "a1" );
  169.   return res;
  170. }
  171.   __inline Object* MUI_MakeObjectA( BASE_PAR_DECL LONG type, ULONG *params)
  172. {
  173.   BASE_EXT_DECL
  174.   register Object* res __asm("d0");
  175.   register struct Library* a6 __asm("a6") = BASE_NAME;
  176.   register LONG d0 __asm("d0")=type;
  177.   register ULONG* a0 __asm("a0")=params;
  178.  
  179.   __asm volatile ("
  180.   jsr a6@(-0x78)"
  181.   : "=r" (res)
  182.   : "r" (a6), "r" (d0), "r" (a0)
  183.   : "d0", "d1", "a0", "a1" );
  184.   return res;
  185. }
  186.  
  187.   Object *MUI_MakeObject(LONG type, ...)
  188. {
  189.   return(MUI_MakeObjectA(type, (ULONG *)(((ULONG)&type)+4)));
  190. }
  191.  
  192.   __inline Object* MUI_NewObjectA( BASE_PAR_DECL char *classname, struct TagItem *tags)
  193. {
  194.   BASE_EXT_DECL
  195.   register Object* res __asm("d0");
  196.   register struct Library* a6 __asm("a6") = BASE_NAME;
  197.   register char* a0 __asm("a0") = classname;
  198.   register struct TagItem* a1 __asm("a1")=tags;
  199.  
  200.   __asm volatile ("
  201.   jsr a6@(-0x1e)"
  202.   : "=r" (res)
  203.   : "r" (a6), "r" (a0), "r" (a1)
  204.   : "d0", "d1", "a0", "a1" );
  205.   return res;
  206. }
  207.   Object* MUI_NewObject(char *class, Tag tag1, ...)
  208. {
  209.  return(MUI_NewObjectA(class, (struct TagItem *) &tag1));
  210. }
  211.  
  212.  
  213.   __inline void MUI_Redraw( BASE_PAR_DECL Object *obj, ULONG flags)
  214. {
  215.   BASE_EXT_DECL
  216.   register res __asm("d0");
  217.   register struct Library* a6 __asm("a6") = BASE_NAME;
  218.   register Object * a0 __asm("a0")=obj;
  219.   register ULONG d0 __asm("d0")=flags;
  220.  
  221.   __asm volatile ("
  222.   jsr a6@(-0x66)"
  223.   : "=r" (res)
  224.   : "r" (a6), "r" (a0), "r" (d0)
  225.   : "d0", "d1", "a0", "a1" );
  226. }
  227.   __inline void MUI_RejectIDCMP( BASE_PAR_DECL Object *obj, ULONG flags)
  228. {
  229.   BASE_EXT_DECL
  230.   register res __asm("d0");
  231.   register struct Library* a6 __asm("a6") = BASE_NAME;
  232.   register Object* a0 __asm("a0")=obj;
  233.   register ULONG  d0 __asm("d0")=flags;
  234.  
  235.   __asm volatile ("
  236.   jsr a6@(-0x60)"
  237.   : "=r" (res)
  238.   : "r" (a6), "r" (a0), "r" (d0)
  239.   : "d0", "d1", "a0", "a1" );
  240. }
  241.   __inline LONG MUI_RequestA( BASE_PAR_DECL APTR app, APTR win,
  242. LONGBITS flags, char *title,char *gadgets,char *format,APTR params)
  243. {
  244.   BASE_EXT_DECL
  245.   register LONG res __asm("d0");
  246.   register struct Library* a6 __asm("a6") = BASE_NAME;
  247.   register APTR d0 __asm("d0")=app;
  248.   register APTR d1 __asm("d1")=win;
  249.   register LONGBITS d2 __asm("d2")=flags;
  250.   register char * a0 __asm("a0")=title;
  251.   register char * a1 __asm("a1")=gadgets;
  252.   register char * a2 __asm("a2")=format;
  253.   register APTR  a3 __asm("a3")=params;
  254.  
  255.   __asm volatile ("
  256.   jsr a6@(-0x2a)"
  257.   : "=r" (res)
  258.   : "r" (a6), "r" (d0), "r" (d1), "r" (d2), "r" (a0), "r" (a1), "r" (a2), "r" (a3)
  259.   : "d0", "d1", "a0", "a1", "d2", "a2", "a3" );
  260.   return res;
  261. }
  262.  
  263.   LONG MUI_Request(APTR app, APTR win, LONGBITS flags, char *title, char *gadgets, char *format, ...)
  264. {
  265.  return(MUI_RequestA(app, win, flags, title, gadgets, format, (APTR) (((ULONG)&format)+4) ));
  266. }
  267.  
  268.  
  269.  
  270.  
  271.   __inline void MUI_RequestIDCMP( BASE_PAR_DECL Object *obj, ULONG flags)
  272. {
  273.   BASE_EXT_DECL
  274.   register res __asm("d0");
  275.   register struct Library* a6 __asm("a6") = BASE_NAME;
  276.   register Object * a0 __asm("a0")=obj;
  277.   register ULONG  d0 __asm("d0")=flags;
  278.  
  279.   __asm volatile ("
  280.   jsr a6@(-0x5a)"
  281.   : "=r" (res)
  282.   : "r" (a6), "r" (a0), "r" (d0)
  283.   : "d0", "d1", "a0", "a1" );
  284. }
  285.   __inline LONG MUI_SetError( BASE_PAR_DECL LONG num)
  286. {
  287.   BASE_EXT_DECL
  288.   register LONG res __asm("d0");
  289.   register struct Library* a6 __asm("a6") = BASE_NAME;
  290.   register LONG d0 __asm("d0")=num;
  291.  
  292.   __asm volatile ("
  293.   jsr a6@(-0x48)"
  294.   : "=r" (res)
  295.   : "r" (a6), "r" (d0)
  296.   : "d0", "d1", "a0", "a1" );
  297.   return res;
  298. }
  299.  
  300.  
  301.  
  302. #undef BASE_EXT_DECL
  303. #undef BASE_PAR_DECL
  304. #undef BASE_PAR_DECL0
  305. #undef BASE_NAME
  306.  
  307. __END_DECLS
  308.  
  309. #endif /* _INLINE_MUIMASTER_H */
  310.  
  311.  
  312.